import React from 'react';
import { Skeleton } from "@/components/ui/skeleton";

function SkeletonTable() {
    return (
        <div className="overflow-x-auto p-4 bg-gray-50 rounded-lg shadow-sm">
            <div className="mb-4">
                <Skeleton className="h-8 w-64 bg-gray-200" />
            </div>
            <table className="min-w-full bg-white rounded-lg overflow-hidden">
                <thead className="bg-gray-100">
                    <tr>
                        {[40, 120, 120, 120, 120].map((width, index) => (
                            <th key={index} className="px-6 py-4">
                                <Skeleton className={`h-6 w-${width} bg-gray-300`} />
                            </th>
                        ))}
                    </tr>
                </thead>
                <tbody>
                    {[1, 2, 3].map((row) => (
                        <tr key={row} className="border-b border-gray-200 hover:bg-gray-50 transition-colors duration-150 ease-in-out">
                            <td className="px-6 py-4">
                                <Skeleton className="h-6 w-10 bg-gray-200" />
                            </td>
                            {[1, 2, 3, 4].map((cell) => (
                                <td key={cell} className="px-6 py-4">
                                    <Skeleton className="h-6 w-full max-w-[120px] bg-gray-200" />
                                </td>
                            ))}
                        </tr>
                    ))}
                </tbody>
            </table>
            <div className="mt-4 flex justify-between items-center">
                <Skeleton className="h-8 w-24 bg-gray-200" />
                <div className="flex space-x-2">
                    {[1, 2, 3].map((btn) => (
                        <Skeleton key={btn} className="h-8 w-8 bg-gray-200 rounded-full" />
                    ))}
                </div>
            </div>
        </div>
    );
}

export default SkeletonTable;